home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / BEHAVIOR / BHVR / COMBHVR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  1.8 KB  |  62 lines

  1. /*$Id: COMBhvr.h 1.2 1996/07/30 01:04:27 Damien Exp $*/
  2.  
  3. //
  4. // COM Example of a Behavior
  5. //
  6.  
  7. #ifndef __COM_BHVR__
  8. #define __COM_BHVR__  
  9.  
  10. #ifndef __I3DEXTBH__
  11. #include "I3DExTbh.h"
  12. #endif
  13.                   
  14. // define the Behavior CLSID
  15.  
  16. // {2F29F160-FCD3-11ce-A4F7-0000E202D5A5}
  17. DEFINE_GUID(CLSID_Behavior,0x2f29f160,0xfcd3,0x11ce,0xa4,0xf7,0x0,0x0,0xe2,0x2,0xd5,0xa5);
  18.  
  19.  
  20.  
  21. typedef struct BehaviorData {
  22.   char fNameObject1[256]; // name of the first object to align to
  23.   char fNameObject2[256]; // name of the second object to align to
  24.   NUM3D fRelPos;         // relative position between the two objects (0 first, 1 second)
  25.   } BehaviorData;
  26.  
  27.  
  28. // Behavior Object :
  29. #undef INTERFACE
  30. #define INTERFACE Behavior
  31. class Behavior : public I3DExTreeBehavior {
  32. public :  
  33.   Behavior();
  34.   ~Behavior();
  35.   
  36.   // IUnknown Interface :
  37.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
  38.   STDMETHODIMP_(ULONG) AddRef(THIS);
  39.   STDMETHODIMP_(ULONG) Release(THIS);
  40.   
  41.   // I3DExtension method :
  42.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  43.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);  
  44.   
  45.   // I3DExDataExchanger methods :
  46.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  47.   STDMETHODIMP_(void*)             GetExtensionDataBuffer(THIS);
  48.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  49.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  50.   STDMETHODIMP_(short)             GetResID(THIS);
  51.   
  52.   // I3DExTreeBehavior methods
  53.   STDMETHODIMP Apply (THIS_ I3DShTreeElement* tree);
  54.     STDMETHODIMP SetGlobalTransform (THIS_ I3DShTreeElement *atree,const MATRIX3D *RR,const VECTOR3D *TT,short mode);
  55. private :
  56.   ULONG           fCRef;      // reference Counter
  57.   BehaviorData    fData;      // Behavior Data
  58.   };
  59.  
  60.  
  61. #endif
  62.